The present disclosure includes a microfiche appendix comprising 1 microfiche and 69 frames. The microfiche appendix comprises appendix A, which contains source code listings of one embodiment of the present invention.
1. Field of the Invention
The present invention relates to the field of graphical and non-graphical software controls, and more particularly to editing controls.
2. Description of the Related Art
Graphical software controls have become commonplace in the field of user interfaces to computer programs, particularly software applications which make use of the graphical user interface (GUI). Examples of controls are list boxes, option buttons, scroll bars, check boxes, text boxes, picture boxes, command boxes, meters, gauges, charts, spread sheet displays, etc. The controls are commonly an integral part of the user interface to xe2x80x9cMICROSOFT WINDOWSxe2x80x9d software applications, for example. The controls are used to get user input and to display output. Additionally, controls can be created for non-user interface components such as timers, interfaces to hardware and data acquisition.
An example of an area in which software applications use controls is in the field of software controlled instrumentation systems. It is common in the field of instrumentation systems for users to interact with instruments via software front panel interfaces rather than through hardware front panels. The instrumentation software programs commonly employ graphical controls such as switches, buttons, knobs, dials, meters, graphs, slider controls, slider indicators, etc. similar to those found on hardware front panels.
Programming systems such as xe2x80x9cVISUAL BASICxe2x80x9d provide an environment for software application developers to create user interfaces including controls. Typically, programming environments provide a set of standard controls. Referring now to FIG. 1, a screen shot of a Visual Basic 4.0 screen is shown. A toolbox of standard controls which Visual Basic 4.0 provides is shown.
Object Linking and Embedding (OLE) Controls, also referred to as Active X Controls, are software components that conform to a standard defined by xe2x80x9cMICROSOFTxe2x80x9d. In many ways, OLE controls are similar to traditional libraries. However, since the standard is well defined, there are many applications that can use any OLE control simply by providing support for the OLE standard. Applications or programming environments which support OLE controls are commonly referred to as xe2x80x9cOLE Control Containersxe2x80x9d or simply xe2x80x9ccontainersxe2x80x9d. Examples of containers are Microsoft""s xe2x80x9cEXCELxe2x80x9d spreadsheet product, xe2x80x9cWORDxe2x80x9d word processor, xe2x80x9cACCESSxe2x80x9d database product, and Visual Basic programming environment. The OLE standard affords software application developers the opportunity to develop custom OLE controls to add into and use in their software applications. Much arduous work is needlessly repeated if a given control must be re-developed for each container. Broadly speaking, a container is a software entity which holds software components.
Controls are typically objects. Therefore, each control has its own set of methods, events and properties. A method is a function which acts on a particular control. For example, a control may possess a xe2x80x9cmovexe2x80x9d method to move the control around on a display screen. An event is an action recognized by a control, such as clicking a mouse or pressing a key. A control has associated code which executes in response to an event recognized by the control. A property is the control""s data (settings or attributes), such as color, shape or size. The properties of a control may be edited, i.e., changed to create the desired user interface.
Controls may have custom properties that are specific to the control. For example, a gauge may have the properties StartAngle and EndAngle describing the range in which the needle may be positioned. A button may have the properties OnColor, and OffColor for two different states. The ability to have custom properties, which the OLE standard provides, is generally more desirable than a standard which restricts properties on a component to a predefined set such as minimum, maximum, and color. However, this ability also presents a challenge to development systems that use the controls. Since each control may have its own unique properties, it is difficult for containers to present the custom properties of the controls to the user for configuration. This is where other attempts at control standards, such as the .VBX standard, have not been as successful as the OLE control standard.
Referring now to FIG. 2, a screen shot shows an instance of a slider control which has been dragged from the toolbox and dropped onto the Form1. The slider has associated properties, which are listed in the Properties window. The developer changes the properties by selecting a property field, such as xe2x80x9cMaxxe2x80x9d (which is set to 10 in FIG. 2), and changing the value. The control reflects the change when the developer enters the change into the Properties window.
In many cases, a list of all properties on the control, such as is provided in the Properties window, is not the most intuitive way for a user to configure a control. Hence, OLE controls can also define one or more interactive dialog boxes for configuring the control in edit-time. These displays are called xe2x80x9cProperty Page Dialogsxe2x80x9d, or xe2x80x9cProperty Sheetsxe2x80x9d. Property sheets allow the OLE control developer to tailor the tools for configuring the properties of the control.
Referring now to FIG. 3, a screen shot shows a Slider Control Properties page dialog in which the developer changes the properties of the slider. FIG. 4 shows the Max tick value property changed from 10 to 20, which is reflected in the slider now having 20 tick marks, rather than 10.
While property sheets allow the developer to present the properties of the control in an intuitive way, property sheets also introduce a new set of problems. For example, as was described in the discussion of FIG. 2, Visual Basic""s property window permits the user to see the effects of changing individual properties as the changes are made. However, as was described in the discussion of FIGS. 3 and 4, property page dialogs do not show the changes until the xe2x80x9cApplyxe2x80x9d button is pressed, and pressing the Apply button applies all changes. If the changes resulted in an undesired behavior, no mechanism exists for undoing the changes, and if multiple changes are made before applying the changes, restoring the control to its original state may prove difficult since the user must remember all the previous settings of the control. A better solution would allow the user to see the effect of all changes without committing or applying them to the control.
Hence, an improved method for editing a control is desired, wherein changes are viewed and evaluated prior to applying the changes to the control. Further, it is desirable for the method to be container independent.
The present invention comprises a novel method for editing a control. The method comprises a user dragging an icon representation of the control and dropping the control onto a form of a container, such as Visual Basic. When the user drops the control, the container constructs the control. The control comprises a standard interface compliant portion and internal control object portions. When the container constructs the control it constructs the standard interface compliant control. Upon being constructed, the standard interface compliant control constructs a first internal control object referenced by an original pointer. The first internal control object comprises the data for the control. The standard interface compliant control provides an interface to the container according to the standard interface, which is preferably the interface of OLE controls. The standard interface compliant control provides a means of redirecting methods invoked upon the control through the standard interface to the internal control object referenced by the original pointer. Thus the control selectively redirects method invocations upon internal control objects by modifying the original pointer.
When the user selects the control for an editing transaction the standard interface compliant control creates a second internal control object which is a copy of the first internal control object, creates a property page dialog, creates a preview window and displays the second control object in the preview window. The user makes changes to the control, either via the property page dialog or via direct graphical interaction with the copy of the control displayed in the preview window. These changes are reflected in the control displayed in the preview window, but not in the form window. The user edits the control as desired in the preview window and applies the changes or cancels the changes.
If the user applies the changes, the standard interface compliant control creates a third internal control object which is a copy of the second internal control object, that is which reflects the user changes, and assigns the original pointer to reference the third internal control object. The standard interface compliant control then discards the first internal control object. If the user cancels the changes, the second internal control object, the preview window and property page dialog are discarded.
Thus, the present invention advantageously provides an improved container independent method for editing a control, wherein changes may be viewed and evaluated prior to applying the changes to the control.